#ifndef FACEBOOK_MODULE
#define FACEBOOK_MODULE

#include "Hw3TypesExtended.h"


/*oOoOoOoOoOoOoOoOoOoOoOoOooOoOoOoOoOoO*/
//			Facebook Module
/*oOoOoOoOoOoOoOoOoOoOoOoOooOoOoOoOoOoO*/
/* This module is in charge of creating a faces and adding it to the face book linked list.  
 *  Since the face book is a joint resource for all threads, adding a face to the face book 
 *  is protected by a mutex.
 */

// AddToFacebookProtected 
// ======================
// The function receives a box of pixels containing a face and adds the face to the 
// head of the face book linked list in a protected manner to avoid collision between 
// different threads.
// Inputs: 
//		- A pointer to a Tbox containing the face we want to add to the face book.
// Outputs:
//		- A pointer to a TFace that is the new added face if successful, or a NULL pointer when failed.
TFace *AddToFacebookProtected (TBox *FoundFaceBox);

// CleanFacebook
// =============
// This function frees all memory allocated for the facebook. It uses the global variable FacebookHead
// and frees each element.
// Call this function before terminating the program.
void CleanFacebook();

#endif